<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <a href="http://www.baidu.com">百度</a>
  <button id="btn">跳转百度</button>
  <script>
    // a标签是什么类型的导航
    //声明式导航
    // 响应button的点击事件, 完成跳转功能, 这种属于什么类型的导航
    var btn = document.querySelector('#btn')
    btn.onclick = function(){
      location.href = 'http://www.baidu.com'
    }

  </script>
</body>

</html>